<?php declare(strict_types=1);

namespace App\Services\Income;

use App\Exceptions\BizException;
use App\Services\Income\Strategy\GtxyIncomeHandler;

class IncomeFactory
{

    protected $instance;

    public function getStrategy(string $api = "gtxy"): IncomeInterface
    {
        switch ($api) {
            case "gtxy":
                $this->instance = new GtxyIncomeHandler();
                break;
            default:
                throw new BizException("api参数异常");
        }
        return $this->instance;
    }
}
